home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  37.6 KB  |  1,052 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992, 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CMApplication;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CMAPPLICATION__}
  28. {$SETC __CMAPPLICATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CMApplicationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __PRINTING__}
  44. {$I Printing.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMICCPROFILE__}
  47. {$I CMICCProfile.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55.  
  56. CONST
  57.     kDefaultCMMSignature        = 'appl';
  58.  
  59. { Macintosh 68K trap word }
  60.     cmTrap                        = $ABEE;
  61.  
  62.  
  63. { PicComment IDs }
  64.     cmBeginProfile                = 220;
  65.     cmEndProfile                = 221;
  66.     cmEnableMatching            = 222;
  67.     cmDisableMatching            = 223;
  68.     cmComment                    = 224;
  69.  
  70. { PicComment selectors for cmComment }
  71.     cmBeginProfileSel            = 0;
  72.     cmContinueProfileSel        = 1;
  73.     cmEndProfileSel                = 2;
  74.     cmProfileIdentifierSel        = 3;
  75.  
  76.  
  77. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  78.     cmMatchCMMType                = $00000001;
  79.     cmMatchApplProfileVersion    = $00000002;
  80.     cmMatchDataType                = $00000004;
  81.     cmMatchDeviceType            = $00000008;
  82.     cmMatchDeviceManufacturer    = $00000010;
  83.     cmMatchDeviceModel            = $00000020;
  84.     cmMatchDeviceAttributes        = $00000040;
  85.     cmMatchFlags                = $00000080;
  86.     cmMatchOptions                = $00000100;
  87.     cmMatchWhite                = $00000200;
  88.     cmMatchBlack                = $00000400;
  89.  
  90. { Defines for version 2.0 CMSearchRecord.searchMask }
  91.     cmMatchAnyProfile            = $00000000;
  92.     cmMatchProfileCMMType        = $00000001;
  93.     cmMatchProfileClass            = $00000002;
  94.     cmMatchDataColorSpace        = $00000004;
  95.     cmMatchProfileConnectionSpace = $00000008;
  96.     cmMatchManufacturer            = $00000010;
  97.     cmMatchModel                = $00000020;
  98.     cmMatchAttributes            = $00000040;
  99.     cmMatchProfileFlags            = $00000080;
  100.  
  101. { Result codes }
  102.                                                                 {  General Errors  }
  103.     cmProfileError                = -170;
  104.     cmMethodError                = -171;
  105.     cmMethodNotFound            = -175;                            {  CMM not present  }
  106.     cmProfileNotFound            = -176;                            {  Responder error  }
  107.     cmProfilesIdentical            = -177;                            {  Profiles the same  }
  108.     cmCantConcatenateError        = -178;                            {  Profile can't be concatenated  }
  109.     cmCantXYZ                    = -179;                            {  CMM cant handle XYZ space  }
  110.     cmCantDeleteProfile            = -180;                            {  Responder error  }
  111.     cmUnsupportedDataType        = -181;                            {  Responder error  }
  112.     cmNoCurrentProfile            = -182;                            {  Responder error  }
  113.                                                                 {  Profile Access Errors  }
  114.     cmElementTagNotFound        = -4200;
  115.     cmIndexRangeErr                = -4201;                        {  Tag index out of range  }
  116.     cmCantDeleteElement            = -4202;
  117.     cmFatalProfileErr            = -4203;
  118.     cmInvalidProfile            = -4204;                        {  A Profile must contain a 'cs1 ' tag to be valid  }
  119.     cmInvalidProfileLocation    = -4205;                        {  Operation not supported for this profile location  }
  120.     cmCantCopyModifiedV1Profile    = -4215;                        {  Illegal to copy version 1 profiles that have been modified  }
  121.                                                                 {  Profile Search Errors  }
  122.     cmInvalidSearch                = -4206;                        {  Bad Search Handle  }
  123.     cmSearchError                = -4207;
  124.     cmErrIncompatibleProfile    = -4208;                        {  Other ColorSync Errors  }
  125.     cmInvalidColorSpace            = -4209;                        {  Profile colorspace does not match bitmap type  }
  126.     cmInvalidSrcMap                = -4210;                        {  Source pix/bit map was invalid  }
  127.     cmInvalidDstMap                = -4211;                        {  Destination pix/bit map was invalid  }
  128.     cmNoGDevicesError            = -4212;                        {  Begin/End Matching -- no gdevices available  }
  129.     cmInvalidProfileComment        = -4213;                        {  Bad Profile comment during drawpicture  }
  130.     cmRangeOverFlow                = -4214;                        {  Color conversion warning that some output color values over/underflowed and were clipped  }
  131.     cmNamedColorNotFound        = -4216;                        {  NamedColor not found  }
  132.     cmCantGamutCheckError        = -4217;                        {  Gammut checking not supported by this ColorWorld  }
  133.  
  134. { deviceType values for ColorSync 1.0 Device Profile access }
  135.     cmSystemDevice                = 'sys ';
  136.     cmGDevice                    = 'gdev';
  137.  
  138. { Commands for CMFlattenUPP(…) }
  139.     cmOpenReadSpool                = 1;
  140.     cmOpenWriteSpool            = 2;
  141.     cmReadSpool                    = 3;
  142.     cmWriteSpool                = 4;
  143.     cmCloseSpool                = 5;
  144.  
  145. { Flags for PostScript-related functions }
  146.     cmPS7bit                    = 1;
  147.     cmPS8bit                    = 2;
  148.  
  149. { Flags for profile embedding functions }
  150.     cmEmbedWholeProfile            = $00000000;
  151.     cmEmbedProfileIdentifier    = $00000001;
  152.  
  153. { Commands for CMAccessUPP(…) }
  154.     cmOpenReadAccess            = 1;
  155.     cmOpenWriteAccess            = 2;
  156.     cmReadAccess                = 3;
  157.     cmWriteAccess                = 4;
  158.     cmCloseAccess                = 5;
  159.     cmCreateNewAccess            = 6;
  160.     cmAbortWriteAccess            = 7;
  161.     cmBeginAccess                = 8;
  162.     cmEndAccess                    = 9;
  163.  
  164.  
  165. { Abstract data type for memory-based Profile }
  166.  
  167. TYPE
  168.     CMProfileRef = ^LONGINT;
  169. { Abstract data type for Profile search result }
  170.     CMProfileSearchRef = ^LONGINT;
  171. { Abstract data type for BeginMatching(…) reference }
  172.     CMMatchRef = ^LONGINT;
  173. { Abstract data type for ColorWorld reference }
  174.     CMWorldRef = ^LONGINT;
  175. { Caller-supplied flatten function }
  176.     CMFlattenProcPtr = ProcPtr;  { FUNCTION CMFlatten(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  177.  
  178. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  179.     CMBitmapCallBackProcPtr = ProcPtr;  { FUNCTION CMBitmapCallBack(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN; }
  180.  
  181. { Caller-supplied filter function for Profile search }
  182.     CMProfileFilterProcPtr = ProcPtr;  { FUNCTION CMProfileFilter(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN; }
  183.  
  184. { Caller-supplied function for profile access }
  185.     CMProfileAccessProcPtr = ProcPtr;  { FUNCTION CMProfileAccess(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  186.  
  187.     CMFlattenUPP = UniversalProcPtr;
  188.     CMBitmapCallBackUPP = UniversalProcPtr;
  189.     CMProfileFilterUPP = UniversalProcPtr;
  190.     CMProfileAccessUPP = UniversalProcPtr;
  191.  
  192. CONST
  193.     uppCMFlattenProcInfo = $00003FE0;
  194.     uppCMBitmapCallBackProcInfo = $000003D0;
  195.     uppCMProfileFilterProcInfo = $000003D0;
  196.     uppCMProfileAccessProcInfo = $0000FFE0;
  197.  
  198. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  199.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  200.     INLINE $2E9F;
  201.     {$ENDC}
  202.  
  203. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  204.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  205.     INLINE $2E9F;
  206.     {$ENDC}
  207.  
  208. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  209.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  210.     INLINE $2E9F;
  211.     {$ENDC}
  212.  
  213. FUNCTION NewCMProfileAccessProc(userRoutine: CMProfileAccessProcPtr): CMProfileAccessUPP;
  214.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  215.     INLINE $2E9F;
  216.     {$ENDC}
  217.  
  218. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  219.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  220.     INLINE $205F, $4E90;
  221.     {$ENDC}
  222.  
  223. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  224.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  225.     INLINE $205F, $4E90;
  226.     {$ENDC}
  227.  
  228. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  229.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  230.     INLINE $205F, $4E90;
  231.     {$ENDC}
  232.  
  233. FUNCTION CallCMProfileAccessProc(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMProfileAccessUPP): OSErr;
  234.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  235.     INLINE $205F, $4E90;
  236.     {$ENDC}
  237.  
  238. TYPE
  239.     CMError                                = LONGINT;
  240. { For 1.0 and 2.0 profile header variants }
  241. { CMAppleProfileHeader }
  242.     CMAppleProfileHeaderPtr = ^CMAppleProfileHeader;
  243.     CMAppleProfileHeader = RECORD
  244.         CASE INTEGER OF
  245.         0: (
  246.             cm1:                CMHeader;
  247.             );
  248.         1: (
  249.             cm2:                CM2Header;
  250.             );
  251.     END;
  252.  
  253. { Param for CWConcatColorWorld(…) }
  254.     CMConcatProfileSetPtr = ^CMConcatProfileSet;
  255.     CMConcatProfileSet = RECORD
  256.         keyIndex:                INTEGER;                                {  Zero-based  }
  257.         count:                    INTEGER;                                {  Min 1  }
  258.         profileSet:                ARRAY [0..0] OF CMProfileRef;            {  Variable. Ordered from Source -> Dest  }
  259.     END;
  260.  
  261. { ColorSync color data types }
  262.     CMRGBColorPtr = ^CMRGBColor;
  263.     CMRGBColor = RECORD
  264.         red:                    INTEGER;                                {  0..65535  }
  265.         green:                    INTEGER;
  266.         blue:                    INTEGER;
  267.     END;
  268.  
  269.     CMCMYKColorPtr = ^CMCMYKColor;
  270.     CMCMYKColor = RECORD
  271.         cyan:                    INTEGER;                                {  0..65535  }
  272.         magenta:                INTEGER;
  273.         yellow:                    INTEGER;
  274.         black:                    INTEGER;
  275.     END;
  276.  
  277.     CMCMYColorPtr = ^CMCMYColor;
  278.     CMCMYColor = RECORD
  279.         cyan:                    INTEGER;                                {  0..65535  }
  280.         magenta:                INTEGER;
  281.         yellow:                    INTEGER;
  282.     END;
  283.  
  284.     CMHLSColorPtr = ^CMHLSColor;
  285.     CMHLSColor = RECORD
  286.         hue:                    INTEGER;                                {  0..65535. Fraction of circle. Red at 0  }
  287.         lightness:                INTEGER;                                {  0..65535  }
  288.         saturation:                INTEGER;                                {  0..65535  }
  289.     END;
  290.  
  291.     CMHSVColorPtr = ^CMHSVColor;
  292.     CMHSVColor = RECORD
  293.         hue:                    INTEGER;                                {  0..65535. Fraction of circle. Red at 0  }
  294.         saturation:                INTEGER;                                {  0..65535  }
  295.         value:                    INTEGER;                                {  0..65535  }
  296.     END;
  297.  
  298.     CMLabColorPtr = ^CMLabColor;
  299.     CMLabColor = RECORD
  300.         L:                        INTEGER;                                {  0..65535 maps to 0..100  }
  301.         a:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  302.         b:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  303.     END;
  304.  
  305.     CMLuvColorPtr = ^CMLuvColor;
  306.     CMLuvColor = RECORD
  307.         L:                        INTEGER;                                {  0..65535 maps to 0..100  }
  308.         u:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  309.         v:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  310.     END;
  311.  
  312.     CMYxyColorPtr = ^CMYxyColor;
  313.     CMYxyColor = RECORD
  314.         capY:                    INTEGER;                                {  0..65535 maps to 0..1  }
  315.         x:                        INTEGER;                                {  0..65535 maps to 0..1  }
  316.         y:                        INTEGER;                                {  0..65535 maps to 0..1  }
  317.     END;
  318.  
  319.     CMGrayColorPtr = ^CMGrayColor;
  320.     CMGrayColor = RECORD
  321.         gray:                    INTEGER;                                {  0..65535  }
  322.     END;
  323.  
  324.     CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  325.     CMMultichannel5Color = RECORD
  326.         components:                PACKED ARRAY [0..4] OF UInt8;            {  0..255  }
  327.     END;
  328.  
  329.     CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  330.     CMMultichannel6Color = RECORD
  331.         components:                PACKED ARRAY [0..5] OF UInt8;            {  0..255  }
  332.     END;
  333.  
  334.     CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  335.     CMMultichannel7Color = RECORD
  336.         components:                PACKED ARRAY [0..6] OF UInt8;            {  0..255  }
  337.     END;
  338.  
  339.     CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  340.     CMMultichannel8Color = RECORD
  341.         components:                PACKED ARRAY [0..7] OF UInt8;            {  0..255  }
  342.     END;
  343.  
  344.     CMNamedColorPtr = ^CMNamedColor;
  345.     CMNamedColor = RECORD
  346.         namedColorIndex:        LONGINT;                                {  0..a lot  }
  347.     END;
  348.  
  349.     CMColorPtr = ^CMColor;
  350.     CMColor = RECORD
  351.         CASE INTEGER OF
  352.         0: (
  353.             rgb:                CMRGBColor;
  354.             );
  355.         1: (
  356.             hsv:                CMHSVColor;
  357.             );
  358.         2: (
  359.             hls:                CMHLSColor;
  360.             );
  361.         3: (
  362.             XYZ:                CMXYZColor;
  363.             );
  364.         4: (
  365.             Lab:                CMLabColor;
  366.             );
  367.         5: (
  368.             Luv:                CMLuvColor;
  369.             );
  370.         6: (
  371.             Yxy:                CMYxyColor;
  372.             );
  373.         7: (
  374.             cmyk:                CMCMYKColor;
  375.             );
  376.         8: (
  377.             cmy:                CMCMYColor;
  378.             );
  379.         9: (
  380.             gray:                CMGrayColor;
  381.             );
  382.         10: (
  383.             mc5:                CMMultichannel5Color;
  384.             );
  385.         11: (
  386.             mc6:                CMMultichannel6Color;
  387.             );
  388.         12: (
  389.             mc7:                CMMultichannel7Color;
  390.             );
  391.         13: (
  392.             mc8:                CMMultichannel8Color;
  393.             );
  394.         14: (
  395.             namedColor:            CMNamedColor;
  396.             );
  397.     END;
  398.  
  399.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  400.     CMProfileSearchRecord = RECORD
  401.         header:                    CMHeader;
  402.         fieldMask:                LONGINT;
  403.         reserved:                ARRAY [0..1] OF LONGINT;
  404.     END;
  405.  
  406.     CMProfileSearchRecordHandle            = ^CMProfileSearchRecordPtr;
  407. { Search definition for 2.0 }
  408.     CMSearchRecordPtr = ^CMSearchRecord;
  409.     CMSearchRecord = RECORD
  410.         CMMType:                OSType;
  411.         profileClass:            OSType;
  412.         dataColorSpace:            OSType;
  413.         profileConnectionSpace:    OSType;
  414.         deviceManufacturer:        LONGINT;
  415.         deviceModel:            LONGINT;
  416.         deviceAttributes:        ARRAY [0..1] OF LONGINT;
  417.         profileFlags:            LONGINT;
  418.         searchMask:                LONGINT;
  419.         filter:                    CMProfileFilterUPP;
  420.     END;
  421.  
  422. { GetCWInfo structures }
  423.     CMMInfoRecordPtr = ^CMMInfoRecord;
  424.     CMMInfoRecord = RECORD
  425.         CMMType:                OSType;
  426.         CMMVersion:                LONGINT;
  427.     END;
  428.  
  429.     CMCWInfoRecordPtr = ^CMCWInfoRecord;
  430.     CMCWInfoRecord = RECORD
  431.         cmmCount:                LONGINT;
  432.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  433.     END;
  434.  
  435. { profile identifier structures }
  436.     CMProfileIdentifierPtr = ^CMProfileIdentifier;
  437.     CMProfileIdentifier = RECORD
  438.         profileHeader:            CM2Header;
  439.         calibrationDate:        CMDateTime;
  440.         ASCIIProfileDescriptionLen: LONGINT;
  441.         ASCIIProfileDescription: SInt8;                                    {  variable length  }
  442.     END;
  443.  
  444. { packing formats }
  445.  
  446. CONST
  447.     cmNoColorPacking            = $0000;
  448.     cmAlphaSpace                = $0080;
  449.     cmWord5ColorPacking            = $0500;
  450.     cmLong8ColorPacking            = $0800;
  451.     cmLong10ColorPacking        = $0A00;
  452.     cmAlphaFirstPacking            = $1000;
  453.     cmOneBitDirectPacking        = $0B00;
  454.     cmAlphaLastPacking            = $0000;
  455.     cm24_8ColorPacking            = $2100;
  456.     cm32_8ColorPacking            = $0800;
  457.     cm40_8ColorPacking            = $2200;
  458.     cm48_8ColorPacking            = $2300;
  459.     cm56_8ColorPacking            = $2400;
  460.     cm64_8ColorPacking            = $2500;
  461.     cm32_16ColorPacking            = $2600;
  462.     cm32_32ColorPacking            = $2700;
  463.  
  464. { general colorspaces }
  465.     cmNoSpace                    = 0;
  466.     cmRGBSpace                    = 1;
  467.     cmCMYKSpace                    = 2;
  468.     cmHSVSpace                    = 3;
  469.     cmHLSSpace                    = 4;
  470.     cmYXYSpace                    = 5;
  471.     cmXYZSpace                    = 6;
  472.     cmLUVSpace                    = 7;
  473.     cmLABSpace                    = 8;
  474.     cmReservedSpace1            = 9;
  475.     cmGraySpace                    = 10;
  476.     cmReservedSpace2            = 11;
  477.     cmGamutResultSpace            = 12;
  478.     cmNamedIndexedSpace            = 16;
  479.     cmMCFiveSpace                = 17;
  480.     cmMCSixSpace                = 18;
  481.     cmMCSevenSpace                = 19;
  482.     cmMCEightSpace                = 20;
  483.  
  484. { supported CMBitmapColorSpaces - each of the following is a }
  485. { combination of a general colospace and a packing formats }
  486.     cmRGBASpace                    = 129;
  487.     cmGrayASpace                = 138;
  488.     cmRGB16Space                = $0501;
  489.     cmRGB32Space                = $0801;
  490.     cmARGB32Space                = $1881;
  491.     cmCMYK32Space                = $0802;
  492.     cmHSV32Space                = $0A03;
  493.     cmHLS32Space                = $0A04;
  494.     cmYXY32Space                = $0A05;
  495.     cmXYZ32Space                = $0A06;
  496.     cmLUV32Space                = $0A07;
  497.     cmLAB32Space                = $0A08;
  498.     cmGamutResult1Space            = $0B0C;
  499.     cmRGB24Space                = $2101;
  500.     cmRGBA32Space                = $0881;
  501.     cmLAB24Space                = $2108;
  502.     cmNamedIndexed32Space        = $2710;
  503.     cmMCFive8Space                = $2211;
  504.     cmMCSix8Space                = $2312;
  505.     cmMCSeven8Space                = $2413;
  506.     cmMCEight8Space                = $2514;
  507.  
  508.  
  509.  
  510. TYPE
  511.     CMBitmapColorSpace                    = LONGINT;
  512.     CMBitmapPtr = ^CMBitmap;
  513.     CMBitmap = RECORD
  514.         image:                    CStringPtr;
  515.         width:                    LONGINT;
  516.         height:                    LONGINT;
  517.         rowBytes:                LONGINT;
  518.         pixelSize:                LONGINT;
  519.         space:                    CMBitmapColorSpace;
  520.         user1:                    LONGINT;
  521.         user2:                    LONGINT;
  522.     END;
  523.  
  524.  
  525. { Classic Print Manager Stuff }
  526.  
  527. CONST
  528.     enableColorMatchingOp        = 12;
  529.     registerProfileOp            = 13;
  530.  
  531.     cmNoProfileBase                = 0;
  532.     cmFileBasedProfile            = 1;
  533.     cmHandleBasedProfile        = 2;
  534.     cmPtrBasedProfile            = 3;
  535.     cmProcedureBasedProfile        = 4;
  536.  
  537.  
  538. TYPE
  539.     CMFileLocationPtr = ^CMFileLocation;
  540.     CMFileLocation = RECORD
  541.         spec:                    FSSpec;
  542.     END;
  543.  
  544.     CMHandleLocationPtr = ^CMHandleLocation;
  545.     CMHandleLocation = RECORD
  546.         h:                        Handle;
  547.     END;
  548.  
  549.     CMPtrLocationPtr = ^CMPtrLocation;
  550.     CMPtrLocation = RECORD
  551.         p:                        Ptr;
  552.     END;
  553.  
  554.     CMProcedureLocationPtr = ^CMProcedureLocation;
  555.     CMProcedureLocation = RECORD
  556.         proc:                    CMProfileAccessUPP;
  557.         refCon:                    Ptr;
  558.     END;
  559.  
  560.  
  561.     CMProfLocPtr = ^CMProfLoc;
  562.     CMProfLoc = RECORD
  563.         CASE INTEGER OF
  564.         0: (
  565.             fileLoc:            CMFileLocation;
  566.             );
  567.         1: (
  568.             handleLoc:            CMHandleLocation;
  569.             );
  570.         2: (
  571.             ptrLoc:                CMPtrLocation;
  572.             );
  573.         3: (
  574.             procLoc:            CMProcedureLocation;
  575.             );
  576.     END;
  577.  
  578.     CMProfileLocationPtr = ^CMProfileLocation;
  579.     CMProfileLocation = RECORD
  580.         locType:                INTEGER;
  581.         u:                        CMProfLoc;
  582.     END;
  583.  
  584. { Profile file and element access }
  585. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  586.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  587.     INLINE $203C, $0008, $001B, $ABEE;
  588.     {$ENDC}
  589. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  590.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  591.     INLINE $203C, $0008, $001C, $ABEE;
  592.     {$ENDC}
  593. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  594.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  595.     INLINE $203C, $0004, $001D, $ABEE;
  596.     {$ENDC}
  597. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  598.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  599.     INLINE $203C, $0004, $0034, $ABEE;
  600.     {$ENDC}
  601. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  602.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  603.     INLINE $203C, $000C, $0025, $ABEE;
  604.     {$ENDC}
  605. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  606.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  607.     INLINE $203C, $000C, $0026, $ABEE;
  608.     {$ENDC}
  609. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  610.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  611.     INLINE $203C, $0008, $003C, $ABEE;
  612.     {$ENDC}
  613. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  614.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  615.     INLINE $203C, $0014, $0031, $ABEE;
  616.     {$ENDC}
  617. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  618.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  619.     INLINE $203C, $0010, $0032, $ABEE;
  620.     {$ENDC}
  621. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  622.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  623.     INLINE $203C, $0008, $0039, $ABEE;
  624.     {$ENDC}
  625. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  626.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  627.     INLINE $203C, $0008, $003A, $ABEE;
  628.     {$ENDC}
  629. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  630.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  631.     INLINE $203C, $000C, $001E, $ABEE;
  632.     {$ENDC}
  633. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: LONGINT): CMError;
  634.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  635.     INLINE $203C, $0008, $001F, $ABEE;
  636.     {$ENDC}
  637. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  638.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  639.     INLINE $203C, $0010, $0020, $ABEE;
  640.     {$ENDC}
  641. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  642.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  643.     INLINE $203C, $0010, $0023, $ABEE;
  644.     {$ENDC}
  645. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: LONGINT): CMError;
  646.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  647.     INLINE $203C, $000C, $0038, $ABEE;
  648.     {$ENDC}
  649. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  650.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  651.     INLINE $203C, $000C, $0035, $ABEE;
  652.     {$ENDC}
  653. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; VAR byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  654.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  655.     INLINE $203C, $0014, $0036, $ABEE;
  656.     {$ENDC}
  657. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  658.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  659.     INLINE $203C, $0014, $0037, $ABEE;
  660.     {$ENDC}
  661. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: LONGINT; VAR tag: OSType; VAR elementSize: LONGINT; VAR refs: BOOLEAN): CMError;
  662.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  663.     INLINE $203C, $0014, $0021, $ABEE;
  664.     {$ENDC}
  665. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: LONGINT; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  666.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  667.     INLINE $203C, $0010, $0022, $ABEE;
  668.     {$ENDC}
  669. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  670.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  671.     INLINE $203C, $0008, $0024, $ABEE;
  672.     {$ENDC}
  673. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  674.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  675.     INLINE $203C, $000C, $003E, $ABEE;
  676.     {$ENDC}
  677. FUNCTION CMCloneProfileRef(prof: CMProfileRef): CMError;
  678.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  679.     INLINE $203C, $0004, $0042, $ABEE;
  680.     {$ENDC}
  681. FUNCTION CMGetProfileRefCount(prof: CMProfileRef; VAR count: LONGINT): CMError;
  682.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  683.     INLINE $203C, $0008, $0043, $ABEE;
  684.     {$ENDC}
  685. FUNCTION CMProfileModified(prof: CMProfileRef; VAR modified: BOOLEAN): CMError;
  686.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  687.     INLINE $203C, $0008, $0044, $ABEE;
  688.     {$ENDC}
  689.  
  690. { named Color access functions }
  691. FUNCTION CMGetNamedColorInfo(prof: CMProfileRef; VAR deviceChannels: LONGINT; VAR deviceColorSpace: OSType; VAR PCSColorSpace: OSType; VAR count: LONGINT; prefix: StringPtr; suffix: StringPtr): CMError;
  692.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  693.     INLINE $203C, $001C, $0046, $ABEE;
  694.     {$ENDC}
  695. FUNCTION CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  696.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  697.     INLINE $203C, $0010, $0047, $ABEE;
  698.     {$ENDC}
  699. FUNCTION CMGetIndNamedColorValue(prof: CMProfileRef; index: LONGINT; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  700.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  701.     INLINE $203C, $0010, $0048, $ABEE;
  702.     {$ENDC}
  703. FUNCTION CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; VAR index: LONGINT): CMError;
  704.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  705.     INLINE $203C, $000C, $0049, $ABEE;
  706.     {$ENDC}
  707. FUNCTION CMGetNamedColorName(prof: CMProfileRef; index: LONGINT; name: StringPtr): CMError;
  708.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  709.     INLINE $203C, $000C, $004A, $ABEE;
  710.     {$ENDC}
  711.  
  712. { Low-level matching functions }
  713. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  714.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  715.     INLINE $203C, $000C, $0014, $ABEE;
  716.     {$ENDC}
  717. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  718.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  719.     INLINE $203C, $0008, $0015, $ABEE;
  720.     {$ENDC}
  721. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  722.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  723.     INLINE $203C, $000C, $0033, $ABEE;
  724.     {$ENDC}
  725. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  726.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  727.     INLINE $203C, $0004, $0001, $ABEE;
  728.     {$ENDC}
  729. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT): CMError;
  730.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  731.     INLINE $203C, $000C, $0002, $ABEE;
  732.     {$ENDC}
  733. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT; VAR result: LONGINT): CMError;
  734.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  735.     INLINE $203C, $0010, $0003, $ABEE;
  736.     {$ENDC}
  737.  
  738. { Bitmap matching }
  739. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  740.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  741.     INLINE $203C, $0010, $002C, $ABEE;
  742.     {$ENDC}
  743. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  744.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  745.     INLINE $203C, $0014, $002D, $ABEE;
  746.     {$ENDC}
  747.  
  748. { Quickdraw-specific matching }
  749. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  750.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  751.     INLINE $203C, $0010, $0004, $ABEE;
  752.     {$ENDC}
  753. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  754.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  755.     INLINE $203C, $0014, $0007, $ABEE;
  756.     {$ENDC}
  757. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  758.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  759.     INLINE $203C, $000C, $0016, $ABEE;
  760.     {$ENDC}
  761. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  762.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  763.     INLINE $203C, $0004, $000B, $ABEE;
  764.     {$ENDC}
  765. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  766.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  767.     INLINE $203C, $000C, $0017, $ABEE;
  768.     {$ENDC}
  769. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  770.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  771.     INLINE $203C, $0002, $000D, $ABEE;
  772.     {$ENDC}
  773. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: LONGINT): CMError;
  774.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  775.     INLINE $203C, $0008, $003B, $ABEE;
  776.     {$ENDC}
  777. FUNCTION CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; VAR size: LONGINT): CMError;
  778.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  779.     INLINE $203C, $000C, $0041, $ABEE;
  780.     {$ENDC}
  781.  
  782. { System Profile access }
  783. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  784.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  785.     INLINE $203C, $0004, $0018, $ABEE;
  786.     {$ENDC}
  787. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  788.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  789.     INLINE $203C, $0004, $0019, $ABEE;
  790.     {$ENDC}
  791.  
  792. { External Profile Management }
  793. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  794.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  795.     INLINE $203C, $0010, $0027, $ABEE;
  796.     {$ENDC}
  797. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: LONGINT): CMError;
  798.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  799.     INLINE $203C, $000C, $0028, $ABEE;
  800.     {$ENDC}
  801. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  802.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  803.     INLINE $203C, $0004, $0029, $ABEE;
  804.     {$ENDC}
  805. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: LONGINT; VAR prof: CMProfileRef): CMError;
  806.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  807.     INLINE $203C, $000C, $002A, $ABEE;
  808.     {$ENDC}
  809. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: LONGINT; VAR profileFile: FSSpec): CMError;
  810.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  811.     INLINE $203C, $000C, $002B, $ABEE;
  812.     {$ENDC}
  813. FUNCTION CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; VAR matchedCount: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  814.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  815.     INLINE $203C, $000C, $003F, $ABEE;
  816.     {$ENDC}
  817. FUNCTION CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; VAR profileList: CMProfileRef; listSize: LONGINT; VAR matchedCount: LONGINT; VAR matchedList: CMProfileRef): CMError;
  818.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  819.     INLINE $203C, $0014, $0040, $ABEE;
  820.     {$ENDC}
  821.  
  822. { Utilities }
  823. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  824.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  825.     INLINE $203C, $000C, $0011, $ABEE;
  826.     {$ENDC}
  827. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  828.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  829.     INLINE $203C, $0008, $001A, $ABEE;
  830.     {$ENDC}
  831. FUNCTION CMConvertProfile2to1(profv2: CMProfileRef; VAR profv1: CMProfileHandle): CMError;
  832.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  833.     INLINE $203C, $0008, $0045, $ABEE;
  834.     {$ENDC}
  835. { ColorSpace conversion functions }
  836. FUNCTION CMConvertXYZToLab({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  837.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  838.     INLINE $203C, $0010, $004B, $ABEE;
  839.     {$ENDC}
  840. FUNCTION CMConvertLabToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  841.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  842.     INLINE $203C, $0010, $004C, $ABEE;
  843.     {$ENDC}
  844. FUNCTION CMConvertXYZToLuv({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  845.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  846.     INLINE $203C, $0010, $004D, $ABEE;
  847.     {$ENDC}
  848. FUNCTION CMConvertLuvToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  849.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  850.     INLINE $203C, $0010, $004E, $ABEE;
  851.     {$ENDC}
  852. FUNCTION CMConvertXYZToYxy({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  853.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  854.     INLINE $203C, $000C, $004F, $ABEE;
  855.     {$ENDC}
  856. FUNCTION CMConvertYxyToXYZ({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  857.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  858.     INLINE $203C, $000C, $0050, $ABEE;
  859.     {$ENDC}
  860. FUNCTION CMConvertRGBToHLS({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  861.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  862.     INLINE $203C, $000C, $0051, $ABEE;
  863.     {$ENDC}
  864. FUNCTION CMConvertHLSToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  865.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  866.     INLINE $203C, $000C, $0052, $ABEE;
  867.     {$ENDC}
  868. FUNCTION CMConvertRGBToHSV({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  869.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  870.     INLINE $203C, $000C, $0053, $ABEE;
  871.     {$ENDC}
  872. FUNCTION CMConvertHSVToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  873.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  874.     INLINE $203C, $000C, $0054, $ABEE;
  875.     {$ENDC}
  876. FUNCTION CMConvertRGBToGray({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  877.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  878.     INLINE $203C, $000C, $0055, $ABEE;
  879.     {$ENDC}
  880. FUNCTION CMConvertXYZToFixedXYZ({CONST}VAR src: CMXYZColor; VAR dst: CMFixedXYZColor; count: LONGINT): CMError;
  881.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  882.     INLINE $203C, $000C, $0056, $ABEE;
  883.     {$ENDC}
  884. FUNCTION CMConvertFixedXYZToXYZ({CONST}VAR src: CMFixedXYZColor; VAR dst: CMXYZColor; count: LONGINT): CMError;
  885.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  886.     INLINE $203C, $000C, $0057, $ABEE;
  887.     {$ENDC}
  888. { PS-related }
  889. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  890.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  891.     INLINE $203C, $0014, $002E, $ABEE;
  892.     {$ENDC}
  893. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  894.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  895.     INLINE $203C, $0014, $002F, $ABEE;
  896.     {$ENDC}
  897. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  898.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  899.     INLINE $203C, $0018, $0030, $ABEE;
  900.     {$ENDC}
  901. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: LONGINT; VAR preferredCMMnotfound: BOOLEAN): CMError;
  902.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  903.     INLINE $203C, $0010, $003D, $ABEE;
  904.     {$ENDC}
  905.  
  906. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  907. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  908.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  909.     INLINE $203C, $000C, $0000, $ABEE;
  910.     {$ENDC}
  911. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  912.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  913.     INLINE $203C, $000C, $000C, $ABEE;
  914.     {$ENDC}
  915. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  916.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  917.     INLINE $203C, $000C, $000A, $ABEE;
  918.     {$ENDC}
  919. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  920.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  921.     INLINE $203C, $000C, $0009, $ABEE;
  922.     {$ENDC}
  923. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  924.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  925.     INLINE $203C, $0004, $0008, $ABEE;
  926.     {$ENDC}
  927. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  928.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  929.     INLINE $203C, $0008, $000E, $ABEE;
  930.     {$ENDC}
  931. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  932.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  933.     INLINE $203C, $0004, $000F, $ABEE;
  934.     {$ENDC}
  935.  
  936. { ProfileResponder functions }
  937. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  938.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  939.     INLINE $203C, $0010, $0005, $ABEE;
  940.     {$ENDC}
  941. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  942.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  943.     INLINE $203C, $000C, $0006, $ABEE;
  944.     {$ENDC}
  945. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  946.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  947.     INLINE $203C, $0010, $0010, $ABEE;
  948.     {$ENDC}
  949. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  950.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  951.     INLINE $203C, $0014, $0012, $ABEE;
  952.     {$ENDC}
  953. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  954.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  955.     INLINE $203C, $000C, $0013, $ABEE;
  956.     {$ENDC}
  957.  
  958. {$IFC OLDROUTINENAMES }
  959. { constants }
  960.  
  961. CONST
  962.     kMatchCMMType                = $00000001;
  963.     kMatchApplProfileVersion    = $00000002;
  964.     kMatchDataType                = $00000004;
  965.     kMatchDeviceType            = $00000008;
  966.     kMatchDeviceManufacturer    = $00000010;
  967.     kMatchDeviceModel            = $00000020;
  968.     kMatchDeviceAttributes        = $00000040;
  969.     kMatchFlags                    = $00000080;
  970.     kMatchOptions                = $00000100;
  971.     kMatchWhite                    = $00000200;
  972.     kMatchBlack                    = $00000400;
  973.  
  974. { types }
  975.  
  976. TYPE
  977.     CMYKColor                            = CMCMYKColor;
  978.     CMYKColorPtr                         = ^CMYKColor;
  979.     CWorld                                = CMWorldRef;
  980.     CMGamutResult                        = ^LONGINT;
  981. { functions }
  982. PROCEDURE EndMatching(myRef: CMMatchRef);
  983.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  984.     INLINE $203C, $0004, $000B, $ABEE;
  985.     {$ENDC}
  986. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  987.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  988.     INLINE $203C, $0002, $000D, $ABEE;
  989.     {$ENDC}
  990. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  991.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  992.     INLINE $203C, $000C, $0011, $ABEE;
  993.     {$ENDC}
  994. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  995.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  996.     INLINE $203C, $000C, $000A, $ABEE;
  997.     {$ENDC}
  998. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  999.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1000.     INLINE $203C, $000C, $0009, $ABEE;
  1001.     {$ENDC}
  1002. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  1003.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1004.     INLINE $203C, $0004, $0008, $ABEE;
  1005.     {$ENDC}
  1006. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  1007.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1008.     INLINE $203C, $0008, $000E, $ABEE;
  1009.     {$ENDC}
  1010. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  1011.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1012.     INLINE $203C, $0004, $000F, $ABEE;
  1013.     {$ENDC}
  1014. {$ENDC}  {OLDROUTINENAMES}
  1015.  
  1016.  
  1017. {  Deprecated stuff }
  1018.  
  1019. { PrGeneral parameter blocks }
  1020.  
  1021. TYPE
  1022.     TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  1023.     TEnableColorMatchingBlk = RECORD
  1024.         iOpCode:                INTEGER;
  1025.         iError:                    INTEGER;
  1026.         lReserved:                LONGINT;
  1027.         hPrint:                    THPrint;
  1028.         fEnableIt:                BOOLEAN;
  1029.         filler:                    SInt8;
  1030.     END;
  1031.  
  1032.     TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  1033.     TRegisterProfileBlk = RECORD
  1034.         iOpCode:                INTEGER;
  1035.         iError:                    INTEGER;
  1036.         lReserved:                LONGINT;
  1037.         hPrint:                    THPrint;
  1038.         fRegisterIt:            BOOLEAN;
  1039.         filler:                    SInt8;
  1040.     END;
  1041.  
  1042. {$ALIGN RESET}
  1043. {$POP}
  1044.  
  1045. {$SETC UsingIncludes := CMApplicationIncludes}
  1046.  
  1047. {$ENDC} {__CMAPPLICATION__}
  1048.  
  1049. {$IFC NOT UsingIncludes}
  1050.  END.
  1051. {$ENDC}
  1052.